package com.njtoyo.taxi.admin.rest.controller.marketing;

import com.alibaba.fastjson.JSON;
import com.njtoyo.taxi.admin.aop.PassToken;
import com.njtoyo.taxi.admin.rest.wrapper.marketing.coupon.CustomerActivityRuleQueryWrapper;
import com.njtoyo.taxi.admin.service.marketing.CustomerActivityService;
import com.taxi.entity.common.RestResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/customer/activity")
@Api(tags = "乘客活动")
@Slf4j
public class CustomerActivityController {

    @Resource
    private CustomerActivityService customerActivityService;

    @PostMapping("/sendRegisterCustomerCoupon")
    @ApiOperation(value = "注册发放乘客活动优惠券")
    @PassToken
    public RestResult queryCustomerActivityRule(@RequestBody CustomerActivityRuleQueryWrapper wrapper) {
        log.info("注册发放乘客活动优惠券,参数:{}", JSON.toJSON(wrapper));
        return customerActivityService.sendCustomerCoupon(wrapper);
    }
}
